﻿using InnoWeb.CEND.Core.Model.Training;
using InnoWeb.CEND.Data.Mapping.BaseMapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InnoWeb.CEND.Data.Mapping.Training
{
    public class TrainingItemMapping : BaseMappingConfiguration<TrainingItem, int>
    {
        public TrainingItemMapping()
        {
            this.Property(a => a.Name).IsRequired().HasMaxLength(100);
            this.Property(a => a.NameTR).IsRequired().HasMaxLength(100);

            this.HasMany(a => a.TrainingContents).WithRequired(a => a.TrainingItem);

            this.Property(a => a.ExpertInfoId);
            this.HasRequired(a => a.Expert).WithMany(a => a.TrainingItems).HasForeignKey(a => a.ExpertInfoId);
        }
    }
}
